#_*_coding:utf-8_*_
from __future__ import unicode_literals

from django.db import models

# Create your models here.
class UserGroup_New(models.Model):
    caption = models.CharField(max_length=64)

    def __unicode__(self):
        return self.caption

class User_New(models.Model):
    username = models.CharField(max_length=64)
    #数据库使用ForeignKey存的时候默认会在后面加一个_id下划线id
    #一定要记住，user_group = models.ForeignKey('UserGroup_New')这一行代指的是对象，对象里边儿一行数据
    user_group = models.ForeignKey('UserGroup_New')

    def __unicode__(self):
        return self.username

# class Host_Now(models.Model):
#     hostname = models.CharField(max_length=64)
#     user_group = models.ForeignKey('UserGroup_New')
#
#     def __unicode__(self):
#         return self.hostname